package com.sgx.learning.luban.thread;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class CallAbleTest implements Callable {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        FutureTask futureTask = new FutureTask(new CallAbleTest());
        new Thread(futureTask).start();
        Object res = futureTask.get();
        System.out.println(res);
    }

    @Override
    public Object call() throws Exception {
        return "test";
    }
}
